<?php

namespace App\Params\Backend;

use App\Params\Param;
/**
 * 优惠券列表查询参数
 *
 * @author: WangBin
 * @date: 2021/7/26
 * @mail: <849850352@qq.com>
 */
class GradeListParams extends Param
{
    public $grade_name;
    public $page_size = 20;
    public $page = 1;
    public $grade_bn;

    public function rules()
    {
        return [
            'grade_name' => 'nullable|string',
            'page_size' => 'nullable|integer',
            'page' => 'nullable|integer',
            'grade_bn' => 'nullable|string'
        ];
    }

    /**
     * @return mixed
     */
    public function getGradeName()
    {
        return $this->grade_name;
    }

    /**
     * @param mixed $grade_name
     */
    public function setGradeName($grade_name): void
    {
        $this->grade_name = $grade_name;
    }

    /**
     * @return int
     */
    public function getPageSize(): int
    {
        return $this->page_size;
    }

    /**
     * @param int $page_size
     */
    public function setPageSize(int $page_size): void
    {
        $this->page_size = $page_size;
    }

    /**
     * @return int
     */
    public function getPage(): int
    {
        return $this->page ? -- $this->page : 0;
    }

    /**
     * @param int $page
     */
    public function setPage(int $page): void
    {
        $this->page = $page;
    }

    /**
     * @return mixed
     */
    public function getGradeBn()
    {
        return $this->grade_bn;
    }

    /**
     * @param mixed $grade_bn
     */
    public function setGradeBn($grade_bn): void
    {
        $this->grade_bn = $grade_bn;
    }
}
